package com.atguigu.exercise;

/**
 * @author RuiKnag
 * @create 2021-05-27-12:51
 */
public class Solution {
    public static void main(String[] args) {
        int t=0;
        T1 t1 = new T1(t);
        T2 t2 = new T2(t);
        Thread th1 = new Thread(t1);
        Thread th2 = new Thread(t2);

        for (int i = 0; i < 100; i++) {
            th1.start();
        }
        for (int i = 0; i < 100; i++) {
            th2.start();
        }
        System.out.println(t);

    }


}
class T1 implements Runnable{
    int num=0;
    public T1(int num) {
        this.num=num;
    }

    @Override
    public void run() {
        num++;
    }
}
class T2 implements Runnable{
    int num=0;
    public T2(int num) {
        this.num=num;
    }

    @Override
    public void run() {
       num++;
    }
}